package org.crmsystem.service.impl;

import org.apache.ibatis.session.SqlSession;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.crmsystem.dao.SysMsgMapper;
import org.crmsystem.model.SysMsg;
import org.crmsystem.service.ISysMsgService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/8/4.
 */
@Service
public class SysMsgServiceImpl implements ISysMsgService {

    @Autowired
    private SysMsgMapper sysMsgMapper;
    /**
     * @param id the id
     * @return
     */
    @Override
    public int deleteByPrimaryKey(Integer id) {

        return sysMsgMapper.deleteByPrimaryKey(id);
    }

    /**
     * @param record the record
     * @return
     */
    @Override
    public int insert(SysMsg record) {

        return sysMsgMapper.insert(record);
    }


    /**
     * 多条件查询
     * @return
     */
    public List<SysMsg> selectBy(Map sysMsg){

        return sysMsgMapper.selectBy(sysMsg);
    }
    /**
     * 多条件查询总记录
     *
     * @param sysMsg the sys msg
     * @return the list
     */
   public int selectByTotalNum(Map sysMsg){
        return sysMsgMapper.selectByTotalNum(sysMsg);
    }




    public List<SysMsg> selectByDate(Date start,Date end){

        return sysMsgMapper.selectByDate(start,end);
    }

    /**
     * @return
     */
    @Override
    public List<SysMsg> select() {

        return sysMsgMapper.select();
    }


}